import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        StringBuilder sb = new StringBuilder();
        char last = str.charAt(0);
        int repeat = 0;
        for (int i = 0; i < str.length(); i++) {
            if(str.charAt(i) == last) {
                repeat++;
            } else {
                sb.append(last).append(repeat);
                last = str.charAt(i);
                repeat = 1;
            }
        }
        //append()方法是StringBuilder和StringBuffer类的核心方法，用于高效地构建字符串
        sb.append(last).append(repeat);
        System.out.println(sb);
    }
}
